<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html>
<head lang="cn">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
    <title>恭喜您获得运动礼劵</title>
    <link href="http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<img src="images/2.jpg" width="100%" height="100%" style="position:absolute; left:0; top: 0; z-index: -1;">
<div style="width: 100%;margin-top:150px;color:#fff;font-size: 25px;font-weight: bold;"class="container">
    <div class="row">
        <br>
        <span class="col-xs-10 col-xs-offset-1">&nbsp;&nbsp;&nbsp;&nbsp;恭喜您获得200元运动礼劵! 请提交手机号码，到活动现场接待处领取。</span><br/>
    </div>
<div class="row">
    <input id="phone" type="text" value="" class="col-xs-10 col-xs-offset-1" style="height:50px;color:#000 !important">
    <input id="submit" type="submit" value="提交" class="btn btn-info span9 btn-info col-xs-10 col-xs-offset-1" style="height:50px;margin-top: 5px">
</div>

</div>
</body>

<script src="js/jquery-1.8.3.min.js"></script>
<script src="http://apps.bdimg.com/libs/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script>
    $(document).ready(function(){
       $("#submit").click(function(){
           var re = /^1\d{10}$/
           if (!re.test($('#phone').val())) {
               alert('手机格式错误！');
               return;
           }

           $.ajax({
               url:'service.php',
               type:"POST",
               data:{action:'commit',phone:$('#phone').val()},
               success:function(data){
                   console.log(data)
                   if(data==1){
                       alert('提交成功！');
                   }else if(data==-2){
                       alert('请不要重复领奖！');
                   }else if(data==-3){
                       alert('请重新摇奖！');
                   }
                   else{
                       alert('提交失败,请重新提交！');
                   }
               }
           })
       })


    })
</script>
</html>